<!DOCTYPE html>
<html lang="en">
	<head>
<style type="text/css">
	#pop_up{ width: 500px; height: 230px; border-top: 10px solid #307ecc; border-bottom: 10px solid #307ecc; background: #ffffff; position:fixed; left:40%; top:40%;}
	#pop_up p{ float: right; position:absolute; right:10px; top:10px;}
</style>
		<include file="Index/head" />
	</head>

	<body>
		<include file="Index/header" />
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>
			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>
				<include file="Index/menu" />
				<div class="main-content">
					<include file="Index/nav" />
					<div class="page-content">						
							<!-- /**
							 * 右侧页面begin
							 */ -->
								<div class="row">
									<div class="col-xs-12">
										<div class="table-header">
											待审核项目 
										</div>
										<div class="table-responsive">
											<div id="sample-table-2_wrapper" class="dataTables_wrapper" role="grid">
											<div class="row">
											<div class="col-sm-6">
											<div id="sample-table-2_length" class="dataTables_length">
											</div>
											</div>
											<div class="col-sm-6" style="margin-bottom:-20px;">
											<div class="dataTables_filter" id="sample-table-2_filter">
											<label>搜索: <input type="text" aria-controls="sample-table-2">
											</label>
											</div>
											</div>
											</div>
											<table id="sample-table-2" class="table table-striped table-bordered table-hover dataTable" aria-describedby="sample-table-2_info">
												<thead>
													<tr role="row">
													<th class="center"><label><input type="checkbox" class="ace" id="check_ace"><span class="lbl"></span></label></th>
													<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending">ID</th>
													<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending">展示图</th><th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Price: activate to sort column ascending">项目名</th>
														<th class="" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Update: activate to sort column ascending" style=" width:200px;">
															套餐类型
														</th>
														<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending">检测机构</th>
														<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending">发起时间</th>
														<!-- <th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending" >结束时间</th> -->
														<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending" >发起人</th>
														<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending" >目标金额</th>
														<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending" >检测金额</th>
														<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending" >已筹金额</th>
                                                        <th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending" >是否支付</th>
                                                        <th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending">项目评论</th>
                                                        <th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending">关注</th>
														<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending"></th>
														<th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" aria-label="" ></th></tr>
												</thead>
											<tbody role="alert" aria-live="polite" aria-relevant="all">
											<!-- 循环开始出 -->
											<volist name="list" id="vo">
											<tr class="odd">
												<td class="center">
													<label>
														<input type="checkbox" class="ace" value="{$vo.id}" name="muser">
														<span class="lbl"></span>
													</label>
												</td>
												<td class=" ">{$vo.id}</td>
												<td class=" "><img src="{$vo.thumb}" style="width:50px; height:50px;"></td>
												<td class=" ">{$vo.pjname}</td>
												<td class=" ">{$vo.packageid}</td>
												<td class="hidden-480 ">{$vo.institutionid}</td>
												<td class=" ">{$vo.btime|date="Y-m-d H:i:s",###}</td>
												<!-- <td class=" ">{$vo.etime|date="Y-m-d",###}</td> -->
												<td class=" ">{$vo.username}</td>
												<td class=" ">{$vo['target_money']/100}</td>
												<td class="hidden-480 ">
													<span class="label label-sm label-warning">{$vo['emoney']/100}</span>
												</td>
												<td class=" ">{$vo['finish_money']/100}</td>
                                                <td class="hidden-480 ">
													<span class="label label-sm label-success">{$vo.payment_status}</span>
												</td>
												<td class=" ">
													<a href="{:U('Admin/Funding/comment_lists',array('id' => $vo['id']))}">
														<span class="label label-sm label-success">{$vo.comment_count}</span>
													</a>
												</td>
												<td class=" ">
													<a href="{:U('Admin/Funding/collection_lists',array('id' => $vo['id']))}">
														<span class="label label-sm label-success">{$vo.collection_count}</span>
													</a>
												</td>
												<td class=" ">
													<a href="{:U('Admin/Funding/agree',array('id' => $vo['id'],'state'=>1))}">
														<div class="btn-group dropup">
															<button class="btn btn-xs btn-success">
																<i class="icon-ok"></i>
																通过
															</button>
														</div>
													</a>
													<a href="{:U('Admin/Funding/refused',array('id' => $vo['id']))}">
														<div class="btn-group dropup">
															<button class="btn btn-xs btn-danger">
																<i class="icon-bolt bigger-110"></i>
																拒绝
															</button>
														</div>
													</a>
													<a href="javascript:upload_thumb({$vo.id})">
														<div class="btn-group dropup">
															<button class="btn btn-xs btn-danger">上传展示图</button>
														</div>
													</a>
												</td>
												<td class=" ">
													<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
														<a class="blue" href="{:U('Admin/Funding/new_lists_detail',array('id' => $vo['id']))}">
															<i class="icon-zoom-in bigger-130" title="详情"></i>
														</a>

														<a class="green" href="{:U('Admin/Funding/modify_new_lists',array('id'=> $vo['id']))}">
															<i class="icon-pencil bigger-130" title="修改" ></i>
														</a>
														<!-- javascript:del_organ({$vo.id}) -->
														<a class="red" href="#" fid="{$vo.id}">
															<i class="icon-trash bigger-130" title="删除" ></i>
														</a>
													</div>

													<div class="visible-xs visible-sm hidden-md hidden-lg">
														<div class="inline position-relative">
															<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
																<i class="icon-caret-down icon-only bigger-120"></i>
															</button>

															<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
																<li>
																	<a href="#" class="tooltip-info" data-rel="tooltip" data-original-title="View">
																		<span class="blue">
																			<i class="icon-zoom-in bigger-120"></i>
																		</span>
																	</a>
																</li>

																<li>
																	<a href="#" class="tooltip-success" data-rel="tooltip" title="" data-original-title="Edit">
																		<span class="green">
																			<i class="icon-edit bigger-120"></i>
																		</span>
																	</a>
																</li>

																<li>
																	<a href="#" class="tooltip-error" data-rel="tooltip" title="" data-original-title="Delete">
																		<span class="red">
																			<i class="icon-trash bigger-120"></i>

																		</span>
																	</a>
																</li>
															</ul>
														</div>
													</div>
												</td>
											</tr>
											</volist>
											<!-- 循环输出结束处 -->
											</tbody>
											</table>
											<div class="row">
												<div class="col-sm-6">
													<div class="dataTables_info" id="sample-table-2_info"></div>
												</div>
												<div class="col-sm-6">
													<div class="dataTables_paginate paging_bootstrap">
													{$page}
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>

							<!-- /**
							 * 右侧页面end
							 */ -->
					</div><!-- /.page-content -->
				</div>

			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<!-- //弹出层上传展示图 -->

		<div id="pop_up" style="display:none;">
			<form action="{:U('Admin/Funding/upload_funding_thumb_newlists')}" method="POST" enctype="multipart/form-data">
				<p>双击关闭</p>
				<input type="file" name="thumb" style="margin-left:10%; margin-top:7%;">
				<input type="text" name="fid" hidden="hidden" id="fid" >
				<input type="submit" value="上传" style="margin-left:10%; margin-top:7%;">
			</form>
		</div>


		<include file="Index/footer" />
		<script type="text/javascript">

		//上传项目展示图
		function upload_thumb(id){
			var id = id;
			$("#pop_up").show();
			$("#fid").val(id);

		}

		$(document).ready(function(){
			$("#pop_up").bind('dblclick',function(){
				$("#pop_up").css('display','none');
			});

			//批量删除项目
			//勾选全部项目
			$("#check_ace").bind('click',function(){
				$(".ace").prop('checked',this.checked);
			});

			//点击删除按钮将所有选择的项目删除或者只删除该条项目
			
			$(".red").bind('click',function(){
				var r = confirm('确定删除该项目?');
				if(r){
					var fid =[]; 
					$('input[name="muser"]:checked').each(function(){ 
						fid.push($(this).val()); 
					});
					if(fid.length == 0){
						fid = $(this).attr('fid');
					}
					// alert(typeof(fid));
					var url = "{:U('Admin/Funding/del_fundings')}";
					$.ajax({
						type: 'get',
						url: url,
						data: {id:fid},
						dataType: 'json',
						success: function(data){
							// alert(data);
							if(data==1){
								window.location.href="{:U('Admin/Funding/new_lists')}";
							}else{

								alert('删除失败!');
							}
						}
					});
					
				}else{

					return false;
				}
			});
		});
		</script>
	</body>
</html>
